/*
import "./style.scss";
// exports closure
const counter = require('./closure-export.js').counter;

var btn = document.createElement('button');
btn.innerText = '加一';
document.body.append(btn);
btn.onclick = function() {
    var div = document.createElement('div');
    div.innerText = 'item_' + counter();
    document.body.appendChild(div);
}*/


import counter from "./counter";
import number from "./number";
const path = require('path');

counter();
number();

if (module.hot) {
    module.hot.accept(['./counter.js', './number.js'], function(context) {
        var base = path.basename(...context, '.js');
        if (base === 'number') {
            var numDom = document.querySelector('#number')
            document.body.removeChild(numDom);
            number()
        }
    })
}